package com.owen.emuns;

import org.apache.pdfbox.pdmodel.common.PDRectangle;

public enum PdfTypeEnums {
    w340h750("1", "340x750", new PDRectangle(30f, 250f, 258f, 565f)),
    w230h150("2", "230x150", new PDRectangle(30f, 705f, 173f, 118f));

    public static PdfTypeEnums getPdfTypeEnums(String code) {
        for (PdfTypeEnums PdfTypeEnum : PdfTypeEnums.values()) {
            if (PdfTypeEnum.getCode().equals(code)) {
                return PdfTypeEnum;
            }
        }
        throw new RuntimeException("该code值" + code + "不存在对应enum");
    }

    private String code;

    private String msg;

    private PDRectangle pdRectangle;


    private PdfTypeEnums(String code, String msg, PDRectangle pdRectangle){
        this.code = code;
        this.msg = msg;
        this.pdRectangle = pdRectangle;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public PDRectangle getPdRectangle() {
        return pdRectangle;
    }

}
